package com.yyfax.pay.depository.vo;

import com.yyfax.pay.common.enums.FuiouDepositStateEnum;
import com.yyfax.pay.common.exception.PayExceptionCode;
import com.yyfax.pay.depository.domain.FuiouChangeCard;

/**
 * 富友存管更换银行卡快照类
 * 
 * @author buyi
 * @date 2018-03-29 11:23:50
 * @since v2.1.3
 */
public class FuiouChangeCardVO {
	private FuiouChangeCard po;

	public static FuiouChangeCardVO newInstantce(FuiouChangeCard po) {
		if (po == null) {
			throw PayExceptionCode.ERROR_ILL_PARAMETER.expMsg("请求参数po不能为空");
		}

		return new FuiouChangeCardVO().setPo(po);
	}

	private FuiouChangeCardVO() {
		super();
	}

	public FuiouChangeCard getPo() {
		return po;
	}

	public FuiouChangeCardVO setPo(FuiouChangeCard po) {
		this.po = po;
		return this;
	}

	public boolean isResult() {
		// 如果订单状态成功、失败，处理中，则直接返回结果
		if (FuiouDepositStateEnum.FAIL.isValue(po.getState()) || FuiouDepositStateEnum.DEALING.isValue(po.getState())
				|| FuiouDepositStateEnum.ACCEPTED.isValue(po.getState()) || FuiouDepositStateEnum.SUCCESS.isValue(po.getState())) {
			return true;
		}

		return false;
	}

	/**
	 * 判断图片处理中状态
	 * 
	 * @author buyi
	 * @date 2018-04-02 10:06:58
	 * @since v2.1.3
	 * @return
	 */
	public boolean isDealing() {
		// 如果订单状态成功、失败，处理中，则直接返回结果
		if (FuiouDepositStateEnum.DEALING.isValue(po.getState())) {
			return true;
		}

		return false;
	}
}
